import { attribute_mana } from '../../../element/attributeMana/Classes/cla_attributeMana';
import { direct_drag_identify, drag_id } from '../DataDefine/sourceData';
import { direct_drag_operate } from './cla_direct_drag_operate/Classes/cla_direct_drag_operate';

const unit_unit_direct_drag_manaTag = 'unit_unit_direct_drag_mana';

class unit_unit_direct_drag_mana {
  get [Symbol.toStringTag]() {
    return unit_unit_direct_drag_manaTag;
  }

  /**
   *
   * @param {HTMLElement} element
   */
  constructor(element) {
    this.attribute_mana = new attribute_mana(element);

    let formate_attri = {
      [direct_drag_identify]: '',
      [drag_id]: random_dragId(),
    };

    this.attribute_mana.setFormateAttribute(formate_attri);

    this.drag_operate = new direct_drag_operate(element);
  }

  /**
   * @type {attribute_mana}
   */
  attribute_mana;

  /**
   * @type {direct_drag_operate}
   */
  drag_operate;
}

function random_dragId() {
  return drag_id + Math.floor(Math.random() * 9000 + 1000);
}

export { unit_unit_direct_drag_mana };
